/*----------------------------------------\ | Return the first position of the character in the string; | |-------------------------------------------| |--------------------------------------------------------------------| |---------------------------| | Inputs: | | str - the string you want to check; | | char - the character you want to find the position; | |--------------------------------------| |--------------------------------------------------------------------| |---------------------------------------| | Usage: %indexc(str,chars); | \----------------------------------------*/ %macro indexc(str,chars); %local i s; %if %length(&chars) %then %do; %do i=1 %to %length(&str); %if %index(&chars,%qsubstr(&str,&i,1)) %then %goto exit; %end; %end; %let i=0; %exit: &i %put; %mend indexc;